package com.yixiu.study.juc.queue;

import java.util.concurrent.LinkedTransferQueue;

/**
 * @CalssName T07_TransferQueue
 * @Description
 * @Author yixiu
 * @Date 2021/6/29 9:59
 * @Verison 1.0
 **/
public class T07_TransferQueue {

    public static void main(String[] args) throws InterruptedException {
        LinkedTransferQueue<String> strs = new LinkedTransferQueue<>();

        new Thread(() -> {
            try {
                System.out.println("task start");
                System.out.println(strs.take());
                System.out.println("task end");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();

        strs.transfer("aaa");

//        strs.put("aaa");

        System.out.println(strs.size());


    }


}
